package com.idlefish.flutterboost.action;

import androidx.annotation.NonNull;

import com.idlefish.flutterboost.FlutterJsonUtil;
import com.idlefish.flutterboost.Messages;
import com.idlefish.flutterboost.intef.MethodCallAction;

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;

public class MethodActionRouteMethod implements MethodCallAction {
    @Override
    public void doAction(Messages.NativeRouterApi api, @NonNull MethodCall methodCall, @NonNull MethodChannel.Result result) {
        Messages.CommonParams params = new Messages.CommonParams();
        params.setPageName(FlutterJsonUtil.toJson(methodCall.arguments));
        api.pushFlutterRoute(params);
    }
}
